﻿<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link type="text/css" rel="stylesheet" href="css/sort.css"></link>
<script type="text/javascript" src="css/editor.js"></script>
<title>{$title}</title>
</head>
<body>
<?php

/*
* change password
*/
$root_path = '../';
include_once $root_path . 'admin/class/cfg.class.php';
include_once $root_path . 'includes/xml/xml_op.php';
include_once $root_path . 'admin/class/member.class.php';


$xml = new xml_op($root_path);

$user = $xml->xml_admin_get();

$id = $user['id'];

$name = $user['name'];

$member = new member($root_path);

if (isset ($_POST['submit'])) {
	$pass = $_POST['pass'];
	$re_pass = $_POST['repass'];
	if (!empty ($pass) && !empty ($re_pass)) {
		if (strlen($pass) > 5 && strlen($re_pass) > 5) {
			$line = $member->member_add($id, $name, $pass, '', $mail, 0);
			if ($line) {
				$info = '<h1>密码更新成功<h1><br/><br/><h2> 2秒后跳转</h2>';
					echo '<META HTTP-EQUIV="Refresh" CONTENT="2;URL=logout.php">';
				exit;

			} else {
				$info = '更新失败';
			}

		} else {
			$info = '最小长度为6';
		}
	} else {
		$info = '密码(重复密码)不为空';
	}

}
?>
<div style="text-align:center;margin:5px;padding:5px">
<h2><?PHP echo  $info ?></h2>
  <h1>用户密码修改</h1>
<br/><br/>
  <form action="" method="POST" name="change pass">
  <label for="name">姓名：
  <input name="name" type="text"  value="<?PHP echo $name ?>" >
  </label><br/><br/>
   <label for="pass">密码：
   <input name="pass" type="text">
  </label><br/><br/>
   <label for="repass">重复：
   <input name="repass" type="text">
  </label><br/><br/>

  <input type="submit" name="submit" value="提交"/>
  &nbsp;&nbsp;&nbsp;&nbsp;
  <input type="reset" name="reset" value="重置"/>


  </form>



</div>



</body></html>
